package com.rsstuan.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;

import com.rsstuan.utils.CityUtils;
import com.rsstuan.utils.StringUtils;

public class QAController extends SpringController{
	
	private String QUESTION_VM = "main/question";
	
	 public ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) {
		String city = null;
		int cityid = 1;
		if (request.getParameter("cityid") != null) {
			try {
				cityid = Integer.parseInt(request.getParameter("cityid"));
				city = CityUtils.getCity(cityid);
			} catch (Exception e) {
			}
		}
		if (city == null)
			city = CityUtils.DEFAULT_CITY;
		return createModelAndView(request, response, QUESTION_VM, "cityid",
				cityid, "city", city);
	}

}
